package com.tuling.spring;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@Aspect
@EnableAspectJAutoProxy
//@Import(AspectJAutoProxyRegistrar.class)
public class AspectConfig {

	// pointcut条件组合示例execution(* com.tuling.UserService.test(String)) or execution(* com.tuling.UserService.test()) or execution(* com.tuling.UserService.test*())
	@AfterReturning(pointcut = "execution(* com.tuling.UserService.test(String)))", returning = "returnValue")
	public void saveOperateLog(JoinPoint jp, Object returnValue) {
		try {
			System.out.println("UserService method aspect...");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
